﻿Public Partial Class TodosPalpites
    Inherits System.Web.UI.Page

    Private IdGP As Integer

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Util.EhVazioNull(Session("IdUsuario")) Then
            Response.Redirect("Login.aspx")
        End If
        IdGP = Request.QueryString("IdGP")
        VerificaHoraLimite()
    End Sub

    Protected Sub VerificaHoraLimite()
        Dim ta As DataSet1TableAdapters.GPTableAdapter = New DataSet1TableAdapters.GPTableAdapter
        Dim table As DataSet1.GPDataTable
        table = ta.GetDataByIdGP(IdGP)
        Dim horaTreino As Date = table.Rows(0).Item("DtTreino")
        Dim horaLimite As Date = horaTreino
        If Date.UtcNow < horaLimite Then
            Response.Redirect("GP.aspx")
        End If
    End Sub

End Class